﻿@model Project.Models.BlogModel

@{
    ViewBag.Title = "Add a Blog";
}

<h2>AddBlog</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Add a blog</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.URL)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.URL)
            @Html.ValidationMessageFor(model => model.URL)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Keywords)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Keywords)
            @Html.ValidationMessageFor(model => model.Keywords)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.categoryID)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.categoryID, new SelectList(ViewBag.Categories as System.Collections.IEnumerable, "Value", "Text"), "Select")
            @Html.ValidationMessageFor(model => model.categoryID)
        </div>

        <p>
            <input type="submit" value="Add" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to profile", "", "Profile") 
</div>
